from ceph.models import Center
from compute.models import Group


def setup_center_config():
    try:
        centers = Center.objects.all()
        if not centers:
            return
    except Exception as e:
        return

    for center in centers:
        try:
            center._save_config_to_file()
        except Exception as e:
            pass
    return


def setup_group_config():
    try:
        groups = Group.objects.all()
        if not groups:
            return
    except Exception as e:
        return

    for group in groups:
        try:
            group._save_config_to_file()
        except Exception as e:
            pass
    return
